/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86136
 * Date: 2025-04-27
 * Time: 20:19
 */
public class Demo53 {
    public static int result = 0;
    public static void main(String[] args) throws InterruptedException {
        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                int count = 0;
                for (int i = 0; i < 500; i++) {
                    count += i;
                }
                result = count;
            }
        };
        Thread t = new Thread(runnable);
        t.start();
        t.join();
        System.out.println(result);
    }
}
